Expand description
Provides 2D sprite rendering functionality.
Modules§
- The sprite prelude.
Structs§
- Struct defining a
Sprite
border with padding values - A 2d material that renders 2d meshes with a texture tinted by a uniform color
- The GPU representation of the uniform data of a
ColorMaterial
. - Helper utility to update
TextureAtlasLayout
on the fly. - Render pipeline data for a given
Material2d
- Adds the necessary ECS resources and render logic to enable rendering entities using the given
Material2d
asset type (which includesMaterial2d
types). - Common
Material2d
properties, calculated for a specific material instance. - Material
Mesh2d Bundle Deprecated A component bundle for entities with aMesh2d
and aMeshMaterial2d
. - Disables wireframe rendering for any entity it is attached to. It will ignore the
Wireframe2dConfig
global setting. - Data prepared for a
Material2d
instance. - Describes a sprite to be rendered to a 2D camera
- Sprite
Bundle Deprecated ABundle
of components for drawing a single sprite from an image. - Adds support for 2D sprite rendering.
- A component that marks entities that aren’t themselves sprites but become sprites during rendering.
- An index into a
TextureAtlasLayout
, which corresponds to a specific section of a texture. - A builder which is used to create a texture atlas from many individual sprites.
- Stores a map used to lookup the position of a texture in a
TextureAtlas
. This can be used to either use and look up a specific section of a texture, or animate frame-by-frame as a sprite sheet. - Stores a mapping from sub texture handles to the related area index.
- Single texture slice, representing a texture rect to draw in a given area
- Slices a texture using the 9-slicing technique. This allows to reuse an image at various sizes without needing to prepare multiple assets. The associated texture will be split into nine portions, so that on resize the different portions scale or tile in different ways to keep the texture in proportion.
- Enables wireframe rendering for any entity it is attached to. It will ignore the
Wireframe2dConfig
global setting. - Sets the color of the
Wireframe2d
of the entity it is attached to. - A
Plugin
that draws wireframes for 2D meshes.
Enums§
- Sets how a 2d material’s base color alpha channel is used for transparency. Currently, this only works with
Mesh2d
. Sprites are always transparent. - How a sprite is positioned relative to its
Transform
. It defaults toAnchor::Center
. - Defines how a texture slice scales when resized
- Controls how the image is altered when scaled.
- System set for sprite rendering.
Constants§
Traits§
- Materials are used alongside
Material2dPlugin
,Mesh2d
, andMeshMaterial2d
to spawn entities that are rendered with a specificMaterial2d
type. They serve as an easy to use high level way to renderMesh2d
entities with custom shader logic.
Functions§
- System calculating and inserting an
Aabb
component to entities with either:
Type Aliases§
- Color
Mesh2d Bundle Deprecated A component bundle for entities with aMesh2d
and aColorMaterial
. RenderCommand
for sprite rendering.- A convenient alias for
Or<With<Sprite>, With<SpriteSource>>
, for use withbevy_render::view::VisibleEntities
.